<!DOCTYPE html>
<html><head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>结伴报名</title>
    <meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no,minimal-ui,viewport-fit=cover">
    <meta name="copyright" content="Copyright (c) 2006-2019 Mafengwo.">
    <meta name="format-detection" content="telephone=no,address=no">
    <meta name="referrer" content="always">
    <meta name="apple-mobile-web-app-capable" content="no">
    <meta name="apple-mobile-web-app-status-bar-style" content="no">
    <meta property="og:title" content="结伴报名 - 马蜂窝">
    <meta property="og:url" content="https://m.mafengwo.cn/together/apply/2286295.html">
    <meta property="og:image" content="https://images.mafengwo.net/mobile/images/logo_2015.png">
    <meta property="og:description" content="">
    <link rel="apple-touch-icon" href="https://images.mafengwo.net/mobile/images/mfw-logo-new.png">
    <script type="text/javascript" async="" charset="utf-8" src="https://c.cnzz.com/core.php?web_id=30081550&amp;t=q"></script><script type="text/javascript" async="" charset="utf-8" src="https://w.cnzz.com/c.php?id=30081550&amp;async=1"></script><script type="text/javascript">
    window.Env = {"CNZZID":30081550,"IS_MOBILE":true,"WWW_HOST":"www.mafengwo.cn","IMG_HOST":"images.mafengwo.net","W_HTTP":"https:\/\/w.mafengwo.cn","P_HOST":"passport.mafengwo.cn","P_HTTP":"https:\/\/passport.mafengwo.cn","PAGELET_HTTP":"https:\/\/pagelet.mafengwo.cn","JS_HOST":"js.mafengwo.net","TONGJI_HOST":"tongji.mafengwo.cn","UID":85873257,"CSTK":"d70ec50448a3c8d0c902e3287d75cc87_a47620e0e0cb7e6b6327437632675c11","GOOGLE_MAP_KEY":"AIzaSyD-Su0x_rPy1xehlMBcMyTqWkU49Bk53nQ","MOBILE_BINDED":true};
</script>
    <link href="/css/mycss/together.css" rel="stylesheet" type="text/css"/>
    <script src="/js/jquery/jquery.min.js"></script>
    <script src="/js/plugins/jrender/jrender.min.js"></script>
    <script src="/js/common.js"></script>
    <link rel="stylesheet" href="/js/plugins/dialog2/dialog.css"/>
    <script src="/js/plugins/dialog2/dialog.min.js"></script>
    <link rel="stylesheet" href="../css/mycss/mycss.css">

<body>
<div id="pos38"></div>
<header class="head2home">
    <a href="/" class="myLogo"></a>
    <div class="rBtn">
        <a href="/" class="home">官网首页</a>
    </div>
</header>

<section class="container">
    <div class="publish">
        <div class="mod-gender">
            <span class="label">性别</span>
            <span class="item _j_gender on" data-gender="1"><i class="male"></i>男生</span>
            <span class="item _j_gender" data-gender="0"><i class="female"></i>女性</span>
        </div>
        <div class="streak"></div>
        <div class="mod-contact">
            <h2>联系方式<span>（仅对报名的人可见）</span></h2>
            <ul class="bd">
                <li><input type="tel" class="_j_phone" placeholder="手机号" value=""></li>
            </ul>
        </div>
        <div class="streak"></div>
        <div class="mod-body">
            <h2>备注</h2>
            <div class="bd">
                <textarea class="_j_note" rows="5" placeholder="两个人能遇到就是缘分"></textarea>
                <p class="_j_error hide">超过<span class="char err">20</span>字</p>
            </div>
        </div>
        <div style="height: 200px;"></div>
    </div>
</section>
<div class="fixed-btm _j_sort_html">
    <div class="btn-group">
        <a class="btn-add submitBtn">确定</a>
    </div>
</div>
<script>
    $(function () {
        //获取路径传过来的结伴游的id
        var params = getParams();
        if (params.id) {
            var togetherId = params.id;
            //性别的回显
            var user = JSON.parse(sessionStorage.getItem("user"));
            var gender = user.gender;
            if(gender!=-1){
                $("._j_gender").removeClass("on");
                $("span[data-gender="+gender+"]").addClass("on");
            }

            //性别图标的点击事件
            $("._j_gender").click(function () {
                console.log(this);
                gender = $(this).data("gender");
                console.log(gender);
                $("._j_gender").removeClass("on");
                if (gender == 1) {
                    $(this).addClass("on");
                }else{

                    $(this).addClass("on");
                }
            });
            //确定的点击功能
            $(".submitBtn").click(function () {
                var tel = $("input[placeholder='手机号']").val();
                var remark = $("textarea").val();
                $.post('/attends',{'together.id':togetherId,'user.id':user.id,tel:tel,remark:remark},function (data) {
                    if (data.success) {
                        window.location.href = '/together/detail.html?id='+togetherId;
                    }
                });
            });
        }


    });

</script>
<!--<link href="https://css.mafengwo.net/mobile/css/search_ad/search_ad.css?1526627473" rel="stylesheet" type="text/css">-->


</body></html>